// VT220KeyMap.cpp: implementation of the CVT220KeyMap class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ansiterminal.h"
#include "VT220KeyMap.h"
#include "GlobalConsts.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CVT220KeyMap::CVT220KeyMap()
{

}

CVT220KeyMap::~CVT220KeyMap()
{

}

CString CVT220KeyMap::TranslateKey(WORD key, BYTE fVirt)
{
	if(fVirt == 0)
	{
		switch(key)
		{
		case VK_INSERT:
			return "\x1B[2~";
		case VK_DELETE:
			return "\x1B[3~";
		case VK_HOME:
			return "\x1B[1~";
		case VK_END:
			return "\x1B[4~";
		case VK_PRIOR:
			return "\x1B[5~";
		case VK_NEXT:
			return "\x1B[6~";
		case VK_LEFT:
			return "\x1B[D";
		case VK_RIGHT:
			return "\x1B[C";
		case VK_UP:
			return "\x1B[A";
		case VK_DOWN:
			return "\x1B[B";
		}
	}
	return EmptyString;
}